<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//重新绑定表单提交
		$("#pay_btn").bind("click", function() {
			$('form').submit();
		});
	});
	//页面计算缴费总额
	function caculate(){
		var amount=$("#amount").val();
		var size=$('input:checkbox[name=perscodes]:checked').length;
		var sum=size*amount;
		$("#payCost").html("本次缴费："+sum+"元");
	}
	</script>
  </head>
  
  <body>
  <form method="post" action="<%=path %>/system/PaymentServlet?m=pay" >
    <div class="panel admin-panel">
    <div class="panel-head">
				<strong class="icon-reorder">未缴费家庭成员信息列表</strong>
			</div>
			<div class="padding border-bottom">
			<ul class="search" style="padding-left:10px;">
				<li>当年缴费标准：￥：${amount}元<input type="hidden" name="amount" id="amount" value="${amount}"/></li>
				<li id="payCost"></li>
				</ul>
			 <table class="table table-hover text-center">
				<tr>
					<th>序号</th>
					<th>农合证号</th>
					<th>成员姓名</th>
					<th>与户主关系</th>
					<th>性别</th>
					<th>出生年月</th>
					<th>身份证号</th>
				</tr>
				<c:forEach var="item" items="${persons}" varStatus="i">
				<tr>
				    <td><input type="checkbox" name="perscodes" value="${item.perscode}" onclick="caculate();"/></td>
					<td>${item.perscode}</td>
					<td>${item.persname}</td>
					<td>
					 <c:if test="${item.relation=='1'}">户主</c:if>
					 <c:if test="${item.relation=='2'}">配偶</c:if>
					 <c:if test="${item.relation=='3'}">子女</c:if>
					 <c:if test="${item.relation=='4'}">父母</c:if>
					</td>
					<td>
					 <c:if test="${item.sex=='1'}">男</c:if>
					 <c:if test="${item.sex=='2'}">女</c:if></td>
					<td>${item.birthday}</td>
					<td>${item.cardID}</td>
				</tr>
				</c:forEach>
				</table>
				<div align="center">
				<button id="pay_btn" class="button bg-main icon-check-square-o"
								type="button">确定缴费</button>
				<button id="print_btn" class="button bg-main icon-print"
								type="button">打印凭证</button>
				
						</div>
			</div>
    </div>
    </form>
  </body>
</html>
